<template>
  <a-tabs v-model:activeKey="editActiveKey">
    <a-tab-pane key="1" :disabled="hiddenLength===0||componentList.length===0">
      <template #tab>
        <span>
           <Icon icon="FileTextOutlined"></Icon>
          属性
        </span>
      </template>
      <template v-if="activeType==='questionTitle'">
        <QuestionTitle></QuestionTitle>
      </template>
      <template v-if="activeType==='questionTextarea'">
        <QuestionTextarea></QuestionTextarea>
      </template>
      <template v-if="activeType==='questionRadio'">
        <QuestionRadio></QuestionRadio>
      </template>
      <template v-if="activeType==='questionParagraph'">
        <QuestionParagraph></QuestionParagraph>
      </template>
      <template v-if="activeType==='questionInput'">
        <QuestionInput></QuestionInput>
      </template>
      <template v-if="activeType==='questionInfo'">
        <QuestionInfo></QuestionInfo>
      </template>
      <template v-if="activeType==='questionCheckbox'">
        <QuestionCheckbox></QuestionCheckbox>
      </template>
    </a-tab-pane>
    <a-tab-pane key="2">
      <template #tab>
        <span>
           <Icon icon="SettingOutlined"></Icon>
          页面设置
        </span>
      </template>
      <PageSetting></PageSetting>
    </a-tab-pane>
  </a-tabs>
</template>

<script setup>
import QuestionTitle from "../InternalForm/QuestionTitle.vue";
import QuestionTextarea from "../InternalForm/QuestionTextarea.vue";
import QuestionRadio from "../InternalForm/QuestionRadio.vue";
import QuestionParagraph from "../InternalForm/QuestionParagraph.vue";
import QuestionCheckbox from "../InternalForm/QuestionCheckbox.vue";
import QuestionInfo from "../InternalForm/QuestionInfo.vue";
import QuestionInput from "../InternalForm/QuestionInput.vue";
import PageSetting from "../InternalForm/PageSetting.vue";
import {storeToRefs} from "pinia";
import {Icon} from "../../utils/Icon.js";
import useQuestion from "../../store/question.js";

const questionStore = useQuestion()
const {activeType, editActiveKey, componentList, hiddenLength} = storeToRefs(questionStore)
</script>

<style scoped>

</style>
